import request from '@/router/axios'

// 获取客户的验光处方表
export function saleOptometryFetchList(query) {
  return request({
    url: '/eims/saleOptometry/list',
    method: 'get',
    params: query
  })
}

// 获取视光检查单列表
export function getOptPortList(personId){
  return request({
    url: '/admin/chkRefractive/getInfoList/' + personId,
    method: 'get'
  })
}

export function saveSaleOptometry(obj) {
  return request({
    url: '/eims/saleOptometry',
    method: 'post',
    data: obj
  })
}

export function updateSaleOptometry(obj) {
  return request({
    url: '/eims/saleOptometry',
    method: 'put',
    data: obj
  })
}
// 获取客户的验光处方表
export function getSaleOptometry(query) {
  return request({
    url: '/eims/saleOptometry/getByParams',
    method: 'get',
    params: query
  })
}

// 新增销售表
export function saleAddObj(obj) {
  return request({
    url: '/eims/sale',
    method: 'post',
    data: obj
  })
}


// 新增销售表
export function getSaleList(query) {
  return request({
    url: '/eims/sale/getPayMoneySalePage',
    method: 'get',
    params: query
  })
}

// 通过personId获取客户的验光处方表
export function getInfoListByPersonId(personId) {
  return request({
    url: '/eims/saleOptometry/getInfoList/'+ personId,
    method: 'get'
  })
}

// 门诊检查批量保存处方信息
export function saveInfoOptometry(obj){
  return request({
    url: '/eims/saleOptometry/saveInfo',
    method: 'post',
    data: obj
  })
}

// 获取当前日期
export function getNowTime(){
  return request({
    url: '/admin/dict/getNowDate',
    method: 'get'
  })
}
